<?php

/**
 * Generated Model class.
 */
class Base_TurnPostPeer extends Db_Peer implements ISingleton
{

    const ID = '`turn_post`.`id`';

    const TURN_ID = '`turn_post`.`turn_id`';

    const POST_ID = '`turn_post`.`post_id`';

    const USER_ID = '`turn_post`.`user_id`';

    const POST_DATE = '`turn_post`.`post_date`';

    const POST_TIME = '`turn_post`.`post_time`';

    const POST_DATETIME = '`turn_post`.`post_datetime`';

    const IMAGE = '`turn_post`.`image`';

    const TEXT = '`turn_post`.`text`';

    const IS_POSTED = '`turn_post`.`is_posted`';

    const CREATED_AT = '`turn_post`.`created_at`';

    const MODIFIED_AT = '`turn_post`.`modified_at`';

    protected $_name = 'turn_post';

    protected $_rowClass = 'TurnPostRow';

    protected $_dependentTables = array();

    protected $_referenceMap = array(
        'TurnTurnId' => array(
            'columns' => 'turn_id',
            'refTableClass' => 'TurnPeer',
            'refColumns' => 'id'
            ),
        'PostPostId' => array(
            'columns' => 'post_id',
            'refTableClass' => 'PostPeer',
            'refColumns' => 'id'
            ),
        'UserUserId' => array(
            'columns' => 'user_id',
            'refTableClass' => 'UserPeer',
            'refColumns' => 'id'
            )
        );

    private static $_instance = null;

    protected $_metadata = array(
        'id' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'turn_post',
            'COLUMN_NAME' => 'id',
            'COLUMN_POSITION' => 1,
            'DATA_TYPE' => 'int',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => true,
            'PRIMARY_POSITION' => 1,
            'IDENTITY' => true
            ),
        'turn_id' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'turn_post',
            'COLUMN_NAME' => 'turn_id',
            'COLUMN_POSITION' => 2,
            'DATA_TYPE' => 'int',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'post_id' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'turn_post',
            'COLUMN_NAME' => 'post_id',
            'COLUMN_POSITION' => 3,
            'DATA_TYPE' => 'int',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'user_id' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'turn_post',
            'COLUMN_NAME' => 'user_id',
            'COLUMN_POSITION' => 4,
            'DATA_TYPE' => 'int',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'post_date' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'turn_post',
            'COLUMN_NAME' => 'post_date',
            'COLUMN_POSITION' => 5,
            'DATA_TYPE' => 'date',
            'DEFAULT' => null,
            'NULLABLE' => true,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'post_time' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'turn_post',
            'COLUMN_NAME' => 'post_time',
            'COLUMN_POSITION' => 6,
            'DATA_TYPE' => 'time',
            'DEFAULT' => null,
            'NULLABLE' => true,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'post_datetime' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'turn_post',
            'COLUMN_NAME' => 'post_datetime',
            'COLUMN_POSITION' => 7,
            'DATA_TYPE' => 'datetime',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'image' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'turn_post',
            'COLUMN_NAME' => 'image',
            'COLUMN_POSITION' => 8,
            'DATA_TYPE' => 'varchar',
            'DEFAULT' => null,
            'NULLABLE' => true,
            'LENGTH' => '255',
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'text' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'turn_post',
            'COLUMN_NAME' => 'text',
            'COLUMN_POSITION' => 9,
            'DATA_TYPE' => 'varchar',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => '255',
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'is_posted' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'turn_post',
            'COLUMN_NAME' => 'is_posted',
            'COLUMN_POSITION' => 10,
            'DATA_TYPE' => 'tinyint',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => true,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'created_at' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'turn_post',
            'COLUMN_NAME' => 'created_at',
            'COLUMN_POSITION' => 11,
            'DATA_TYPE' => 'datetime',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'modified_at' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'turn_post',
            'COLUMN_NAME' => 'modified_at',
            'COLUMN_POSITION' => 12,
            'DATA_TYPE' => 'timestamp',
            'DEFAULT' => '0000-00-00 00:00:00',
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            )
        );

    /**
     * @return TurnPostPeer
     */
    public static function getInstance()
    {
        if (!self::$_instance) {
        	self::$_instance = new TurnPostPeer();
        }
        return self::$_instance;
    }

    /**
     * @return Db_Rowset
     */
    public function findById($id)
    {
        $select = $this->select();
        $select->where('`id` = ?', $id);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByTurnId($turn_id)
    {
        $select = $this->select();
        $select->where('`turn_id` = ?', $turn_id);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByPostId($post_id)
    {
        $select = $this->select();
        $select->where('`post_id` = ?', $post_id);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByUserId($user_id)
    {
        $select = $this->select();
        $select->where('`user_id` = ?', $user_id);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByPostDate($post_date)
    {
        $select = $this->select();
        $select->where('`post_date` = ?', $post_date);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByPostTime($post_time)
    {
        $select = $this->select();
        $select->where('`post_time` = ?', $post_time);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByPostDatetime($post_datetime)
    {
        $select = $this->select();
        $select->where('`post_datetime` = ?', $post_datetime);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByImage($image)
    {
        $select = $this->select();
        $select->where('`image` = ?', $image);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByText($text)
    {
        $select = $this->select();
        $select->where('`text` = ?', $text);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByIsPosted($is_posted)
    {
        $select = $this->select();
        $select->where('`is_posted` = ?', $is_posted);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByCreatedAt($created_at)
    {
        $select = $this->select();
        $select->where('`created_at` = ?', $created_at);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByModifiedAt($modified_at)
    {
        $select = $this->select();
        $select->where('`modified_at` = ?', $modified_at);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }


}

